﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MenusList.ascx.cs" Inherits="SERP.Modules.Menus.MenusList" %>
<%@ Register Src="~/Modules/Systems/Menus/DropDownListMenus.ascx" tagname="DropDownListMenus" tagprefix="Menus" %>
<%@ Register Src="~/Modules/Systems/Modules/DropDownListModules.ascx" tagname="DropDownListModules" tagprefix="Modules" %>
<div class="ftitle">
    <a class="ftitlelink" onclick='<%="expandCollapseSearch(\"dvsMenus\",\"imgsMenus\",\""+hsMenus.ClientID+"\",\"drdown.jpg\",\"closeup.jpg\",true);" %>'>
        <asp:HiddenField runat="server" ID="hsMenus" Value="0" />
        <img id='imgsMenus' src='<%=ResolveUrl("~/App_Themes/Default/img/drdown.jpg")%>'>
        <span id="lblTitle" runat="Server" enableviewstate="false"></span></a>
    <div class="toolbar">
        <asp:Button ID="btnHelps" runat="server" Text="Helps" OnClientClick="showHelp(window.localtion)" />
        <asp:Button ID="btnDelete" runat="server" Text="Delete" OnClick="OnDelete" />
        <asp:Button ID="btnAddNew" runat="server" Text="Addnew" OnClick="OnAddNew" />
    </div>
</div>
<div class="form" id="dvsMenus" style='display:none'>
	<div class="frow"> 
	<asp:Label ID="labelMenuName" runat="server" Text="MenuName" CssClass="label"  EnableViewState="False"></asp:Label>
			<asp:TextBox runat="server" ID="txtMenuName"  Width="400"></asp:TextBox>
	</div>
	<div class="frow"> 
	<asp:Label ID="labelDescription" runat="server" Text="Description" CssClass="label"  EnableViewState="False"></asp:Label>
			<asp:TextBox runat="server" ID="txtDescription"  Width="400"></asp:TextBox>
	</div>
	<div class="frow"> 
	<asp:Label ID="labelIconName" runat="server" Text="IconName" CssClass="label"  EnableViewState="False"></asp:Label>
			<asp:TextBox runat="server" ID="txtIconName"  Width="400"></asp:TextBox>
	</div>
	<div class="frow"> 
	<asp:Label ID="labelMenuUrl" runat="server" Text="MenuUrl" CssClass="label"  EnableViewState="False"></asp:Label>
			<asp:TextBox runat="server" ID="txtMenuUrl"  Width="400"></asp:TextBox>
	</div>
	<div class="frow">
		<asp:Label ID="labelParentId" runat="server" Text="ParentId" CssClass="label"  EnableViewState="False"></asp:Label>
	    <Menus:DropDownListMenus runat="server" ID="txtParentId" IsAddChooseItem="false" IsAddAllItem="true"  Width="400"></Menus:DropDownListMenus>
	</div>
	<div class="frow">
		<asp:Label ID="labelModuleId" runat="server" Text="ModuleId" CssClass="label"  EnableViewState="False"></asp:Label>
	    <Modules:DropDownListModules runat="server" ID="txtModuleId" IsAddChooseItem="false" IsAddAllItem="true"  Width="400"></Modules:DropDownListModules>
	</div>
	<div class="btnbar">
			 <asp:Button ID="btnSearch" runat="server" CssClass="button" ValidationGroup="btnSearch" onclick="btnSearch_Click" 
				 Text="Tìm kiếm" Width="80px" />
	</div>
</div>
<table class="grid">
    <tr>
        <td class="tblhleft" style="width:34px">
            <input type="checkbox" id="cbkCheckAllMenus" name="cbkCheckAllMenus" onclick="SelectAllCheckboxes(this,'cbkMenus')"
                onchange="selectAllCheckboxes(this,'cbkMenus')">
        </td>
        <td class="tblh" style="width:34px">
        	<%=SERP.Constants.APP_INDEX%>
        </td>
        <td class="tblh">                    
			<%=SERP.StringMappings.MenusStringMapping.MenuName%>
        </td>
        <td class="tblh">                    
			<%=SERP.StringMappings.MenusStringMapping.Description%>
        </td>
        <td class="tblh">                    
			<%=SERP.StringMappings.MenusStringMapping.IconName%>
        </td>
        <td class="tblh">                    
			<%=SERP.StringMappings.MenusStringMapping.MenuUrl%>
        </td>
        <td class="tblh" style="width:30px;text-align:center">                    
		<%=SERP.Constants.APP_EDIT%>
		</td>
        <td class="tblh" style="width:30px;text-align:center">                    
		<%=SERP.Constants.APP_DELETE%>
		</td>
    </tr>
	<asp:Repeater runat="server" ID="gridData" >
		<ItemTemplate>
	<tr>
		<td class="tblcleft">
			<asp:CheckBox ID="cbkMenus" Runat="server"/>
		</td>
		<td class="tblc">
			<%#Container.ItemIndex+1%>
		</td>
		<td class="tblc">
			<asp:LinkButton CommandArgument='<%#string.Concat("&MenuId="+Eval("MenuId"))%>' OnCommand="btnXem_OnCommand" runat="server">     
			<%#Eval("MenuName")%>
			</asp:LinkButton>
		</td>  
		<td class="tblc">
			<asp:LinkButton CommandArgument='<%#string.Concat("&MenuId="+Eval("MenuId"))%>' OnCommand="btnXem_OnCommand" runat="server">     
			<%#Eval("Description")%>
			</asp:LinkButton>
		</td>  
		<td class="tblc">
			<asp:LinkButton CommandArgument='<%#string.Concat("&MenuId="+Eval("MenuId"))%>' OnCommand="btnXem_OnCommand" runat="server">     
			<%#Eval("IconName")%>
			</asp:LinkButton>
		</td>  
		<td class="tblc">
			<asp:LinkButton CommandArgument='<%#string.Concat("&MenuId="+Eval("MenuId"))%>' OnCommand="btnXem_OnCommand" runat="server">     
			<%#Eval("MenuUrl")%>
			</asp:LinkButton>
		</td>  
		<td class="tblc" style="text-align:center">
			<asp:LinkButton ID="btnSua" runat="server" CommandArgument='<%#string.Concat("&MenuId="+Eval("MenuId"))%>' OnCommand="btnSua_OnCommand">
				<asp:Image ID="imgEdit" runat="server" style="border: 0" ImageUrl="~/App_Themes/Default/img/edit.jpg"/>
			</asp:LinkButton>
		</td>
		<td class="tblc" style="text-align:center">
			<asp:LinkButton ID="btnXoa" runat="server" CommandArgument='<%#string.Concat("&MenuId="+Eval("MenuId"))%>' OnCommand="btnXoa_OnCommand">
				<asp:Image ID="imgDelete" runat="server" style="border: 0" ImageUrl="~/App_Themes/Default/img/delete.jpg"/>
			</asp:LinkButton>
		</td>
	</tr>
		</ItemTemplate>
	</asp:Repeater>
</table>
<% if (this.IsPostBack)
{%>
<script type="text/javascript">
    expandCollapseSearch("dvsMenus","imgsMenus","<%=hsMenus.ClientID%>","drdown.jpg","closeup.jpg",false);
</script>
<%}%>
